import ConsoleIndexPage from "../pages/console/./index/consoleIndexPage";
import {
    ClusterOutlined,
    HomeOutlined,
    InteractionOutlined,
    RocketOutlined,
    SettingOutlined,
    TeamOutlined,
    UnorderedListOutlined,
    UserOutlined
} from "@ant-design/icons";
import UserPage from "../pages/console/user/consoleUserPage";
import ConsoleSettingPage from "../pages/console/setting/consoleSettingPage";
import ConsoleUserDetail from "../pages/console/user/consoleUserDetail";
import ConsoleOperationLogPage from "../pages/console/operationLog/consoleOperationLogPage";
import ConsoleTraceLogPage from "../pages/console/traceLog/consoleTraceLogPage";
import ConsoleRolePage from "../pages/console/role/consoleRolePage";
import ConsoleRoleDetail from "../pages/console/role/consoleRoleDetail";
import ServiceGovernancePage from "../pages/console/governance/serviceGovernancePage";
import ServiceGovernanceDetail from "../pages/console/governance/serviceGovernanceDetail";
import ConsoleTaskPage from "../pages/console/task/consoleTaskPage";
import ConsoleTaskDetail from "../pages/console/task/consoleTaskDetail";
import ConsoleMqPage from "../pages/console/mq/consoleMqPage";
import ConsoleTopicPage from "../pages/console/mq/consoleTopicPage";

/**
 * 网站控制台路由配置类
 *
 * <p> path: 访问页面的路径 </p>
 * <p> element: 页面组件 </p>
 * <p> title: 页面对应的菜单名称 </p>
 * <p> icon: 页面对应的菜单图标 </p>
 * <p> isShow: 是否显示在菜单栏中 </p>
 * <p> pageCode: 页面编码, 用于判断用户是否由访问此页面的权限 </p>
 */
const ConsoleRoutes = [

    // ====================== 首页 ======================
    {
        path: '/console/index',
        element: <ConsoleIndexPage/>,
        title: "首页",
        breadcrumb: "首页",
        icon: <HomeOutlined/>,
        isShow: true,
        pageCode: 'index'
    },

    // ====================== 用户管理 ======================
    {
        path: '/console/user',
        element: <UserPage/>,
        title: "用户管理",
        breadcrumb: "用户管理",
        icon: <UserOutlined/>,
        isShow: true,
        pageCode: 'userList'
    },
    {
        path: '/console/user/:operation/:userId',
        element: <ConsoleUserDetail/>,
        title: "用户详情",
        breadcrumb: "用户管理 / 用户详情",
        isShow: false,
        pageCode: 'userDetail'
    },

    // ====================== 角色管理 ======================
    {
        path: '/console/role',
        element: <ConsoleRolePage/>,
        title: "角色管理",
        breadcrumb: "角色管理",
        icon: <TeamOutlined/>,
        isShow: true,
        pageCode: 'roleList'
    },
    {
        path: '/console/role/:operation/:roleId',
        element: <ConsoleRoleDetail/>,
        title: "角色详情",
        breadcrumb: "角色管理 / 角色详情",
        isShow: false,
        pageCode: 'roleDetail'
    },

    // ====================== 服务治理 ======================
    {
        path: '/console/governance',
        element: <ServiceGovernancePage/>,
        title: "服务治理",
        breadcrumb: "服务治理",
        icon: <ClusterOutlined/>,
        isShow: true,
        pageCode: 'serviceGovernanceList'
    },
    {
        path: '/console/governance/:operation/:serviceGovernanceId',
        element: <ServiceGovernanceDetail/>,
        title: "服务详情",
        breadcrumb: "服务治理 / 服务详情",
        isShow: false,
        pageCode: 'serviceGovernanceDetail'
    },

    // ====================== 定时任务 ======================
    {
        path: '/console/task',
        element: <ConsoleTaskPage/>,
        icon: <InteractionOutlined/>,
        title: "定时任务",
        breadcrumb: "定时任务管理",
        isShow: true,
        pageCode: 'scheduledTaskList'
    },
    {
        path: '/console/task/:operation/:taskId',
        element: <ConsoleTaskDetail/>,
        title: "定时任务",
        breadcrumb: "定时任务管理 / 定时任务详情",
        isShow: false,
        pageCode: 'scheduledTaskDetail'
    },

    // ====================== 消息队列 ======================
    {
        path: '/console/mq',
        icon: <RocketOutlined/>,
        title: "消息队列",
        breadcrumb: "消息队列管理",
        isShow: true,
        children: [
            {
                path: '/console/mq/topic',
                element: <ConsoleTopicPage/>,
                title: "主题Topic",
                breadcrumb: "消息队列管理 / 消息主题 Topic 管理",
                isShow: true,
                pageCode: 'mqTopicList'
            }, {
                path: '/console/mq/message',
                element: <ConsoleMqPage/>,
                title: "消息列表",
                breadcrumb: "消息队列管理 / 消息列表",
                isShow: true,
                pageCode: 'mqMessageList'
            }
        ]
    },

    // ====================== 系统日志 ======================
    {
        path: '/console/log',
        element: null,
        title: "系统日志",
        breadcrumb: "系统日志",
        icon: <UnorderedListOutlined/>,
        isShow: true,
        children: [
            {
                path: '/console/log/operation',
                element: <ConsoleOperationLogPage/>,
                title: "操作日志",
                breadcrumb: "系统日志 / 操作日志",
                isShow: true,
                pageCode: 'operationLogList'
            },
            {
                path: '/console/log/trace',
                element: <ConsoleTraceLogPage/>,
                title: "链路追踪日志",
                breadcrumb: "系统日志 / 链路追踪日志",
                isShow: true,
                pageCode: 'traceLogList'
            }
        ]
    },

    // ====================== 个人设置 ======================
    {
        path: '/console/setting',
        element: <ConsoleSettingPage/>,
        title: "个人设置",
        breadcrumb: "个人设置",
        icon: <SettingOutlined/>,
        isShow: true,
        pageCode: 'personalSetting'
    }
]

export default ConsoleRoutes;